package edu.ar.bases.dvdstore.domainmodel.repositories;

import java.util.Collection;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import edu.ar.bases.dvdstore.domainmodel.entities.Dvd;
import edu.ar.bases.dvdstore.domainmodel.repositories.interfaces.IDvdRepository;



public class DvdRepository extends HibernateDaoSupport implements IDvdRepository  {
	
	public DvdRepository() {
		super();
	}

	
	public Collection<Dvd> findAll()
	{
		return this.getHibernateTemplate().loadAll(Dvd.class);
	}

	
	public void save(Dvd entity)
	{
		this.getHibernateTemplate().save(entity);
	}
	
	
	public Dvd findById(Integer dvdID)
	{
		return (Dvd)this.getHibernateTemplate().get(Dvd.class, dvdID);
	}
}
